<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>登录页</title>
	<%@ include file="/common/meta.jsp" %>
	<script src="${ctx}/js/jquery.js" type="text/javascript"></script>
	<link href="${ctx}/css/bootstrap.css" rel="stylesheet">
	<link href="${ctx}/css/docs.css" rel="stylesheet">
</head>

<body>
<div class="topbar">
	</div>
	<div id="masthead">
		<h1>
			逸讯殡仪馆管理系统
			<small>Design in Chengdu</small>
		</h1>
	</div>
<div class="container">	
		<%if ("1".equals(request.getParameter("error"))) {%>
			<div class="alert-message error"> 用户名、密码错误,请重试.</div>
		<%
			}
			if ("2".equals(request.getParameter("error"))) {
		%>
			<div class="alert-message error"> 验证码错误,请重试.</div>
		<%
			}
			if ("3".equals(request.getParameter("error"))) {
		%>
			<div class="alert-message error"> 此帐号已从别处登录.</div>
		<%
			}
			if ("4".equals(request.getParameter("error"))) {
		%>
			<div class="alert-message error">您选择的套账存在问题！</div>
		<%}%>
		
	<div class="row">
		<form id="loginForm" action="${ctx}/j_spring_security_check" method="post" >
			<fieldset style="width: 240px">
				<legend>用户登录</legend>
					<div class="clearfix">
	          			  <label>用户名:</label> 
				          <div class="input">
				          	<input type='text' id='j_username' name='j_username' class="required large" value="admin"/>
				          </div>
       			 	</div>
       			 	<div class="clearfix">
	          			  <label>密码:</label> 
				          <div class="input">
				          	<input type='password' id='j_password' name='j_password' class="required large" value="admin"/>
				          </div>
       			 	</div>
       			 	<div class="clearfix">
	          			  <label>数据库:</label> 
				          <div class="input">
				          	<select name="archSelect" class="required large">
							 	<c:forEach items="${archList}" var="arch">
							 		<option value="${arch.id}">${arch.name}</option>
							 	</c:forEach>
							 </select>
				          </div>
       			 	</div>
			</fieldset>
			<div class="actions">
						<input value="登录" type="submit" class="btn primary"/>
						<input type="reset" value="重置" class="btn"/>
					</div>
		</form>
	</div>
</div>
	
	<div id="footer" style="margin-bottom: 0px;bottom: 0px;">
      <p class="right"><a href="#">Back to top</a></p>
      <p>
        &nbsp;&nbsp;<strong>Version 1.5.0</strong>
      </p>
	</div>
</body>
</html>

